@echo off
echo 启动CourseHub微服务...
echo.

echo 正在启动API网关 (端口8080)...
start "API Gateway" cmd /k "cd /d api-gateway && mvn spring-boot:run"
timeout /t 5 /nobreak >nul

echo 正在启动用户管理服务 (端口8081)...
start "User Service" cmd /k "cd /d user-management-service && mvn spring-boot:run"
timeout /t 5 /nobreak >nul

echo 正在启动课程管理服务 (端口8082)...
start "Course Service" cmd /k "cd /d course-management-service && mvn spring-boot:run"
timeout /t 5 /nobreak >nul

echo 正在启动练习管理服务 (端口8083)...
start "Exercise Service" cmd /k "cd /d exercise-management-service && mvn spring-boot:run"
timeout /t 5 /nobreak >nul

echo 正在启动学习进度服务 (端口8084)...
start "Progress Service" cmd /k "cd /d learning-progress-service && mvn spring-boot:run"

echo.
echo 所有微服务正在启动中...
echo API网关: http://localhost:8080
echo 用户管理服务: http://localhost:8081
echo 课程管理服务: http://localhost:8082
echo 练习管理服务: http://localhost:8083
echo 学习进度服务: http://localhost:8084
echo.
echo 请等待所有服务完全启动后再进行测试。
pause